﻿package
{
	public class ASF
	{
		/* ------------------------------------------------------- */
		public static const GROUND_LEVEL:uint			= 160;
		
		/* ------------------------------------------------------- */
		public static const SCORE_PENALTY_DEATH:int 		= -100;
		public static const SCORE_PENALTY_ROCK_BIG_LANDS:int 	= -5;
		public static const SCORE_PENALTY_ROCK_SMALL_LANDS:int 	= -10;
		public static const SCORE_PENALTY_SPINNER_LANDS:int 	= -100;
		
		public static const SCORE_ROCK_SMALL:uint 		= 20;
		public static const SCORE_ROCK_BIG:uint 		= 10;
		
		public static const SCORE_SPINNER_BIG:uint 		= 40;
		public static const SCORE_SPINNER_SMALL:uint 		= 80;
		
		public static const SCORE_SEEKER:uint 			= 50;
		
		public static const SCORE_UFO:uint 			= 100;
		
		/* ------------------------------------------------------- */
		public static const STARTING_LIVES:uint			= 3;
		public static const THRESHOLD_1UP:uint 			= 1000;
		
		/* ------------------------------------------------------- */
		// This is implicit in the score tables now, but is left here as documentation.
		//public static const THRESHOLD_UFO:uint		= 20000;
		
		/* ------------------------------------------------------- */
		public static const MAX_ROCKS_LARGE:uint 		= 10;
		public static const MAX_ROCKS_SMALL:uint 		= 20;
		
		public static const MAX_SPINNERS_LARGE:uint 		= 2;
		public static const MAX_SPINNERS_SMALL:uint 		= 2;
		
		public static const MAX_SEEKERS:uint 			= 1; 		// ONE IS ENOUGH. Christ.
		
		/* ------------------------------------------------------- */
		public static const MIN_ROCK_DROP_SPEED:int		= 1;
		public static const MAX_ROCK_DROP_SPEED:int		= 100;

		public static const MIN_SPINNER_DROP_SPEED:int		= 1;
		public static const MAX_SPINNER_DROP_SPEED:int		= 75;
		
		public static const MIN_ROCK_DRIFT:int			= 0;
		public static const MAX_ROCK_DRIFT:int			= 0;
		

		public static const MIN_ROCK_BREAK_SPEED:int		= 20;
		public static const MAX_ROCK_BREAK_SPEED:int		= 60;
		
		public static const MIN_ROCK_BREAK_DRIFT:int		= 2;
		public static const MAX_ROCK_BREAK_DRIFT:int		= 40;
		
		public static const SEEKER_SPEED_X:int 			= 250;
		public static const SEEKER_SPEED_Y:int 			= 100;
		
		public static const UFO_SPEED:uint			= 100;
		public static const UFO_MAX_Y:uint			= 200 / 2;
		public static const UFO_SHOT_SPEED:Number		= 0.6;
		
		/* ------------------------------------------------------- */
		public static const MAX_PLAYER_SHOTS:int		= 1;   		// Maximum shots on screen at once
		public static const PLAYER_SHOT_DELAY:Number		= 0.005; 	// Delay between shots
		
		/* ------------------------------------------------------- */
		public static const _rock_colors:Array 			= [0xffff4e57, 0xffa496ff, 0xffffb41f, 0xff00a756, 0xfffaea50, 0xffc9cfab];
	
		/*
		 * 1x  level : Black background : Score up to 999
		 * 2x  level : Blue background : Score 1,000-4,999
		 * 3x  level : Purple background : Score 5,000-19,999
		 * 4x  level : Turquoise background : Score 20,000-49,999
		 * 5x  level : Gray background : Score 50,000-99,999
		 * 6x  level : Black background : Score 100,000 and over
		 */
		
		public static const MAX_LEVEL:uint 			= 6;
		public static const _level_thresholds:Array 		= [1000, 5000, 20000, 50000, 100000];
		public static const _level_colors:Array 		= [0xffffffff, 0xff0000ff, 0xffff00ff, 0xff00ffff, 0xffffff00, 0xffffffff];
		
		/* Hard coded tables for spawn frequency, now, instead of using some formula yanked out of my ass. */
		public static const _spawnFreq:uint			= 10000;
		public static const _spawnFreq_Rocks:Array		= [80,90,100,120,200,300];
		public static const _spawnFreq_Spinners:Array		= [5,8,10,20,30,50];
		public static const _spawnFreq_Seekers:Array		= [2,5,10,15,20,30];
		public static const _spawnFreq_UFO:Array		= [0,0,0,3,5,8];
		
		public static function getMultiplier(score:int):int
		{
			var level:int = 0;
			for each(var lev:int in _level_thresholds) {
				if (score < lev) break;
				level++;
			}
			
			return level;
		}
	}

}